<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:sg="http://java.sun.com/jsf/composite/ezcomp">
    <h:head>
        <title>Ranking</title>
        <h:outputStylesheet library="css" name="Main.css" />
        <h:outputStylesheet library="css" name="Form.css" />
        <h:outputStylesheet library="css" name="TopMenu.css" />
        <h:outputStylesheet library="css" name="Footer.css" />
        <h:outputStylesheet library="css" name="Chart.css" />
        <h:outputStylesheet library="css" name="tipsy.css" />
        <h:outputScript library="javascript" name="jQuery.js" />
        <h:outputScript library="javascript" name="highcharts.js" />
    </h:head>
    <h:body>
        <sg:pageHeader >
            <ui:param name="menu" value="true" />
        </sg:pageHeader>
        <h:form id="mainForm" />
        <div class="bigChart" id="friends"></div>
        <div class="images">
            <ul class="friendList">
                <h:outputText escape="false" value="#{rankingBackingBean.images}" />
            </ul>
        </div>
        <script type="text/javascript">
 
                var chart;
                jQuery(document).ready(function() {
                        chart = new Highcharts.Chart({
                                chart: {
                                        renderTo: 'friends',
                                        defaultSeriesType: 'bar'
                                },
                                title: {
                                        text: 'Ranking de Amigos'
                                },
                                
                                xAxis: {
                                        categories : <h:outputText escape="false" value="#{rankingBackingBean.categories}" />
                                },
                                yAxis: {
                                        min: 0,
                                        title: {
                                                text: 'Eletrecidade gasta (kw)',
                                                align: 'high'
                                        }
                                },
                                
                                plotOptions: {
                                        bar: {
                                                dataLabels: {
                                                        enabled: false
                                                }
                                        }
                                },
                                
                                tooltip: {
                                    enabled: false
                                    
                                },
                                
                                credits: {
                                        enabled: false
                                },
                                series: [{
                                        name: 'Gasto Energético',
                                        data: <h:outputText escape="false" value="#{rankingBackingBean.values}" />
                                }]
                        });
			
			
                });
        </script>

        <sg:pageFooter />
    </h:body>
</html>

